mm: populate_physmap: validate correctly the gfn for direct mapped domain
authorJulien Grall <julien.grall@citrix.com>
Thu, 13 Aug 2015 12:41:09 +0000 (14:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 13 Aug 2015 12:41:09 +0000 (14:41 +0200)
commit9503ab0e9c6a41a1ee7a70c8ea9313d08ebaa8c5
tree22d2d8649d16981a3140d8e752af458e98558158
parent23d01fc3768e72e82a40cbe781409856d63d4f5c
mm: populate_physmap: validate correctly the gfn for direct mapped domain

Direct mapped domain has already the memory allocated 1:1, so we are
directly using the gfn as mfn to map the RAM in the guest.

While we are validating that the page associated to the first mfn belongs to
the domain, the subsequent MFN are not validated when the extent_order
is > 0.

This may result to map memory region (MMIO, RAM) which doesn't belong to the
domain.

Although, only DOM0 on ARM is using a direct memory mapped. So it
doesn't affect any guest (at least on the upstream version) or even x86.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/common/memory.c